function getpostslist(json) {
	document.write('<ul class="post-list">');
	
	for (var i = 0; i < json.feed.entry.length; i++) {
		for (var j = 0; j < json.feed.entry[i].link.length; j++) {
			if (json.feed.entry[i].link[j].rel == 'alternate') {
				break;
			}
		}
		
		var entryUrl = json.feed.entry[i].link[j].href;
		var entryTitle = json.feed.entry[i].title.$t;
		var entrySummary = json.feed.entry[i].summary.$t;
		var entryThumbnail = json.feed.entry[i].media$thumbnail;
		if(entryThumbnail == null) {
			entryThumbnail = 'http://i.imgur.com/Xhpc14t.jpg';
		}else{
			entryThumbnail = entryThumbnail.url.replace('s72-c', 's300');
		}
		
		var item = '<li><a href="'+entryUrl+'" title="'+entryTitle+'" class="thumb"><img src="'+entryThumbnail+'" alt="'+entryTitle+'" /></a><a href="'+entryUrl+'" title="'+entryTitle+'" class="post-title">'+entryTitle+'</a><p class="summary">'+entrySummary+'...</p><div class="clear"></div></li>';
		
		document.write(item);
	}
	
	document.write('</ul>');
}
function ShowPost(Numpost, Label, HomeUrl) {
	if(Numpost == null) var Numpost = 10;
	if(HomeUrl == null || HomeUrl == '') var HomeUrl = homepageUrl;
	var HomeUrl = HomeUrl.replace('http://', '');
	var HomeUrl = HomeUrl.replace('/', '');
	
	if(Label == null || Label == ''){
		document.write("<script src=\"http://"+HomeUrl+"/feeds/posts/summary?max-results="+Numpost+"&alt=json-in-script&callback=getpostslist\"><\/script>");
	}else{
		document.write("<script src=\"http://"+HomeUrl+"/feeds/posts/summary/-/"+Label+"?max-results="+Numpost+"&alt=json-in-script&callback=getpostslist\"><\/script>");
		document.write('<p class="readmore"><a href="http://'+HomeUrl+'/search/label/'+Label+'">&raquo; Read more</a></p>');
	}
}
